<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/vue2.4.0.js"></script>
		<script src="js/jquery-1.11.0.min.js"></script>
		<script src="js/main.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<link href="css/bootstrap.min.css" type="text/css" rel="stylesheet" />
	</head>
	<body style="height: 100%;">
		<div id="app">
			<div>
			<nav id="nav-head" class="navbar navbar-default navbar-fixed-top" style="background-color: rgba(255,255,255,1);border: none;">
				<div class="container" style="margin-top: 20px;height: 100%;">
					<row>
						<button class="btn btn-success mybtn" data-toggle="modal" data-target="#exampleModa2">新建</button>
						<button class="btn btn-primary mybtn" @click="getType(1)">查询用户</button>
						<button class="btn btn-primary mybtn" @click="getType(2)">查询管理员</button>
						<button class="btn btn-primary mybtn" @click="getType(3)">查询文件</button>
						<button class="btn btn-primary mybtn" @click="getType(4)">查询文件夹</button>
						<button class="btn btn-danger mybtn" @click="logout()">登出系统</button>
						<a style="float: right;">当前管理员：--<font style="color:red;" v-html="admin[0] ? admin[0].adminName : ''"></font></a>
						<h3 v-show="objType==1">用户管理</h3>
						<h3 v-show="objType==2">管理员管理</h3>
						<h3 v-show="objType==3">文件管理</h3>
						<h3 v-show="objType==4">文件夹管理</h3>
						<input type="text" class="form-control text-center" v-model="keys" style="margin-top: 20px;" placeholder="请键入关键字"/>
					</row>
					<div class="table-responsive">
					  <table class="table table-hover" style="margin-bottom: 0;">
					    <thead>
					      	<!--<th>账号</th>
					      	<th>密码</th>
					      	<th>昵称</th>
					      	<th>email</th>
					      	<th>手机</th>
					      	<th>注册时间</th>
					      	<th>状态</th>
					      	<th>身份</th>
					      	<th>操作</th>-->
					    	<th v-for="j in head[objType-1]" v-html="j" class="text-center tableObj2"></th>
					 		<th>操作</th>
					      </tr>
					    </thead>
					  </table>
					</div>
				</div>
			</nav>
			
		
			<div id="dataTable" class="container" style="margin-top: 150px;height: 100%;">
				<div class="table-responsive">
				  <table class="table table-hover" :data="list">
				  	<tr style="visibility: hidden;z-index: -1000;"><td v-for="j in head[objType-1]" v-html="j" class="text-center tableObj1"></td></tr>
			  		<tr v-for="(item,i) in search()" :key="item.id">
			  			<template v-for="j in head[objType-1]">
					    	<td v-html="item[j]" class="text-center"></td>
				 		</template>
				 		<td>
							<button class="btn btn-primary" style="margin-right: 10px;" data-toggle="modal" data-target="#exampleModa1" @click="modifyObj =Object.assign({}, item);">修改</button>
							<button class="btn btn-danger" @click="delect(item.id,i)">删除</button>
						</td>
				   </tr>
				  </table>
				</div>
			</div>
			<!--修改模态框-->
			<div class="modal fade mod" id="exampleModa1" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
			    <div class="modal-dialog" role="document">
			        <div class="modal-content">
			            <div class="modal-header">
			                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
			                        aria-hidden="true">×</span></button>
			                <h4 class="modal-title" id="exampleModalLabel">信息修改</h4>
			            </div>
			            <div class="modal-body">
			                <form>
			                	<template v-for="(item,i) in head[objType-1]">
			                    <div class="form-group">
			                        <label for="recipient-name" class="control-label" v-html="item"></label>
			                        <input type="text" class="form-control" v-model="modifyObj[item]" >
			                    </div>
			                	</template>
			                </form>
			            </div>
			            <div class="modal-footer">
			                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			                <button type="button" class="btn btn-primary" @click="modify()">确定</button>
			            </div>
			        </div>
			    </div>
			</div>
			<!--新增模态框-->
			<div class="modal fade mod" id="exampleModa2" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabe2">
			    <div class="modal-dialog" role="document">
			        <div class="modal-content">
			            <div class="modal-header">
			                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
			                        aria-hidden="true">×</span></button>
			                <h4 class="modal-title" id="exampleModalLabe2">信息新增</h4>
			            </div>
			            <div class="modal-body">
			                <form>
			                	<template v-for="(item,i) in head[objType-1]">
			                    <div class="form-group">
			                        <label for="recipient-name" class="control-label" v-html="item"></label>
			                        <input type="text" class="form-control" v-model="newObj[item]" >
			                    </div>
			                	</template>
			                </form>
			            </div>
			            <div class="modal-footer">
			                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			                <button type="button" class="btn btn-primary" @click="add()">确定</button>
			            </div>
			        </div>
			    </div>
			</div>
		</div>
		</div>	
	</body>
</html>
<script src="js/top-config.js"></script>
<script src="js/back_vue.js"></script>
